# 推导式  表达式   for  语句  条件
# for x in range(1, 100001):
#     print(x)

# 列表推导式
# l0 = [x*x+2*x+5 for x in range(1, 100001) if x <= 10]
# print(l0, type(l0))

# 元组推导式  结果类型是生成器
# t0 = (100*x for x in range(1000) if x % 2 == 0)
# # print(t0, type(t0))
# for e in t0:
#     print(e)

# 字典推导式
# d0 = {f"key_{x}": f"{x**2+2*x+8}" for x in range(10) if x > 5}
# print(d0, type(d0))

# 集合推导式
set0 = {f"x_{x}" for x in range(10) if x <= 3}
print(set0, type(set0))